#pragma once
#include "syncobject.h"

namespace cupid
{
class CriticalSection : public SyncObject
{

private:
	using SyncObject::Unlock;

	// Constructor
public:
	CriticalSection();

	// Attributes
public:
	operator CRITICAL_SECTION*();
	CRITICAL_SECTION m_sect;

	// Operations
public:
	BOOL Unlock();
	BOOL Lock();
	BOOL Lock(DWORD dwTimeout);

	// Implementation
public:
	virtual ~CriticalSection();

private:
	BOOL Init();
};
}